<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="${rootPath}/css/a.css" type="text/css" rel="stylesheet" />
<link href="${rootPath}/css/index.css" type="text/css" rel="stylesheet" />
<link href="${rootPath}/css/common.css" type="text/css" rel="stylesheet" />
<title>银行卡四要素管理</title>

<script type="text/javascript"
	src="<s:url value="/js/jquery-1.3.2.js" />"></script>
<script type="text/javascript" src="<s:url value="/js/common.js" />"></script>
<script language="javascript" type="text/javascript"
	src="<s:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
<script type='text/javascript' src='<s:url value="/dwr/engine.js"/>'></script>
<script type='text/javascript' src='<s:url value="/dwr/interface/MccQuery.js"/>'></script>
<script type="text/javascript">
$(document).ready(function(){
	$('#sub').click(function(){
		if(!checkSubDate()){
			return false;
		}
		$("#bankCardFourKeyForm").attr("action","<%=basePath%>/bankcardfourkey/queryBankCardFourKeyList.ct");
		$("#bankCardFourKeyForm").submit();
		$(this).attr("disabled","true");
	});
	$("#delFourKey").click(function() {
		var dd = $("input[name=sNum]:checked");
		if(dd.length <= 0){
			alert("请选择至少一条记录进行操作！");
			return false;
		}
		if(!window.confirm("您确定要删除吗？")){
			  return;
		}
		var sNums = "";
		for(var k = 0; k < dd.length; k++){
			var sNum = dd[k].value;
			sNums = sNums + sNum + ",";
		}
 		$("#bankCardFourKeyForm").attr("action","<%=basePath%>/bankcardfourkey/delFourKeyInfo.ct?accountNos="+sNums);
		$("#bankCardFourKeyForm").submit(); 
    });
});	

function str2date(str){
	var d=null;
	var reg=/^(\d{4})(\d{2})(\d{2})$/ ;
		if(arr=str.match(reg))d=new   Date(Number(arr[1]),Number(arr[2])-1,Number(arr[3])) ; 
	return d;
}

function checkSubDate(){
	var beginTime = $("#minDate").val().replace(/-/g, "");
	var endTime = $("#maxDate").val().replace(/-/g, "");
	var date1=str2date(beginTime);
	var date2=str2date(endTime);
	if(date1 != null && date2 == null){
		alert("创建时间:【请填写完整的时间范围】");
		return false;
	}
	if(date1 == null && date2 != null){
		alert("创建时间：【请填写完整的时间范围】");
		return false;
	}
	if(date1 != null && date2 != null && date2 < date1){
		alert("创建时间：【选择的结束时间不能小于起始时间】");
		return false;
	}
	return true;
}

</script>
</head>
<body>
<table class="tb">
    <tbody>
		<s:form id="bankCardFourKeyForm"  method="post" value="queryBankCardFourKeyList.ct" namespace="/bankcardfourkey"  theme="simple">
			
	        <tr class="tb-line">
	            <td class="tb-td" colspan="4"><div class="tb-h2">POS收单运营管理平台</div></td>
	        </tr>
	
	        <tr class="tb-line">
	            <td class="tb-td" colspan="4"><div class="tb-h3">银行卡四要素查询</div></td>
	        </tr>
	        
			<tr class="tb-line">
				<td width="12%" style="min-width: 150px" align="right" class="tb-td">
			         <div class="tb-h4">手机号：</div>
			    </td>
				<td class="tb-td" >
	                <label class="tb-input-normal">
						<s:textfield id="phoneNo" name="searchCondition.phoneNo" cssClass="queryWidth" />
					</label>
	            </td>
	            <td align="right" class="tb-td">
	                <div class="tb-h4">姓名：</div>
	            </td>
				<td class="tb-td">
              		<label class="tb-input-normal">
              		    <s:textfield id="accountName" name="searchCondition.accountName" cssClass="queryWidth" />
            		</label>
				</td>
			</tr>
			<tr class="tb-line">
				<td width="12%" style="min-width: 150px" align="right" class="tb-td">
			         <div class="tb-h4">银行卡号：</div>
			    </td>
				<td class="tb-td" >
	                <label class="tb-input-normal">
						<s:textfield id="accountNo" name="searchCondition.accountNo" cssClass="queryWidth" />
					</label>
	            </td>
	            <td align="right" class="tb-td">
	                <div class="tb-h4">身份证号：</div>
	            </td>
				<td class="tb-td">
              		<label class="tb-input-normal">
              		    <s:textfield id="identityCard" name="searchCondition.identityCard" cssClass="queryWidth" />
            		</label>
				</td>
			</tr>
			<tr class="tb-line">
				<td width="12%" style="min-width: 150px" align="right" class="tb-td">
				<div class="tb-h4">创建时间：</div></td>
				<td class="tb-td">
					<label class="tb-input-normal"><s:textfield id="minDate" name="searchCondition.minDate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,wdate:true,errDealMode:0});"
						theme="simple" cssClass="queryWidth" /> </label>-
					<label class="tb-input-normal"><s:textfield id="maxDate" name="searchCondition.maxDate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,wdate:true,errDealMode:0});"
						theme="simple" cssClass="queryWidth" /></label>
				</td>
			</tr>	
			<tr>
				<td colspan="4" align="center"><div style="color: blue;">
						<s:actionmessage />
					</div>
					<div style="color: red;">
						<s:actionerror />
					</div>
				</td>
			</tr>

			<tr class="tb-line">
				<td class="tb-td line-submit" align="right" colspan="6">
               		<label class="tb-input-submit">
				 		<s:submit value="查询" id="sub" /> 
	                </label>
	                <label class="tb-input-submit">
			             <s:reset value="取消" />
	                </label>
	                <label class="tb-input-submit">
	                    <input id="delFourKey" type="button"  value="删除" />
	                </label>
				</td>
			</tr>
			<table width="100%" cellpadding="0" cellspacing="0" border="0">
				<s:if
					test="#request.searchRsList != null && #request.searchRsList.size>0">
					<tr class="tb-line">
						<td class="tb-td paging" colspan="4" align="left">&nbsp;&nbsp;&nbsp;&nbsp; <page:pageCount
								max_pages="11" totalPage="${requestScope.totalPage}"
								currentPage="${requestScope.currentPage}"
								action="${rootPath}/bankcardfourkey/queryBankCardFourKeyList.ct?currentPage=" />

						</td>
					</tr>
				</s:if>
			</table> 
		</s:form>
    </tbody>
</table>
<div class="big-tb">
    <table class="tb" style="width: 100%;">
		<thead>
            <tr class="tb-line">
                <th class="tb-th" colspan="6">银行卡四要素信息列表</th>
            </tr>
			<tr class="tb-line bg-gray">
              		<th class="tb-th">选择</th>
			    <th class="tb-th">手机号</th>
				<th class="tb-th">银行卡号</th>
				<th class="tb-th">姓名</th>
				<th class="tb-th">身份证号</th>
				<th class="tb-th">创建时间</th>
			</tr>
		</thead>
		<tbody>
		    <s:iterator value="#request.searchRsList" status="stat" id="wvbean">
			<tr class="tb-line">
				<td align="center" class="tb-td">
				<s:checkboxlist name="sNum" list="#{#wvbean.accountNo}" value=""  theme="simple"  />
		        </td>
				<td class="tb-td" align="center">
				 <s:property value="#wvbean.phoneNo"/>
				</td>
				<td class="tb-td" align="center">
				 <s:property value="#wvbean.accountNo"/>
				</td>
				<td class="tb-td" align="center">
				 <s:property value="#wvbean.accountName"/>
				</td>
				<td class="tb-td" align="center">
				 <s:property value="#wvbean.identityCard"/>
				</td>
				<td class="tb-td" align="center">
				 <s:property value="#wvbean.createTime"/>
				</td>
			</tr>
			</s:iterator>
	   </tbody>
    </table>
</div>
<s:if test="#request.msg !=null">
	<script language="javascript">
		alert("${request.msg}");
	</script>
</s:if>
<s:if test="#request.msg1 !=null&&#request.msg ==null">
	<script language="javascript">
		alert("${request.msg1}");
	</script>
</s:if>
</body>
</html>